//
//  Node.cpp
//  WiFiMACSim
//
//  Created by Christopher Kemsley on 3/31/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#include "Node.hpp"
#include "Medium.hpp"
#include "System.hpp"

SimNamespaceBegin




Node :: ~Node ()
	{
	
	}

void	Node :: markMyMessagesAsFailed	( Medium::MsgSet const & set )
	{
	Medium::MsgSet::const_iterator	here	=	set.begin() ;
	Medium::MsgSet::const_iterator	end		=	set.end() ;
	while ( here != end )
		{
		Message * m = *(here++) ;
		if ( m->target == identity )
			m->status = Message::kStatusFailedToReceive ;
		}
	}


// Call this
Node :: Node ( ID const & node )
:	identity ( node )
	{
	
	}




void	Node :: runFromRunLoop ( RunLoop & sender , RunLoop::Mode mode )
	{
	update ( System::shared().currentSlot() , Medium::shared().environment(identity) ) ;
	}




SimNamespaceEnd
